<template>
  <div
    class="q-container element-rect"
    v-if="$options.filters._nil(items, false)"
  >
    {{ context }}
    <el-input v-model="context.mode" />
    <el-button @click="set(context, 'mode3', 'testse')">改变</el-button>
    <draggable
      class="list-group"
      :value="items"
      @input="
        (val) => {
          $emit('propChange', 'items', val);
        }
      "
      group="controlGroup"
    >
      <q-element :key="item.uuid" v-for="item in items" :schema="item" />
    </draggable>
  </div>
</template>
<script>
import Vue from "vue";
export default {
  name: "QContainer",
  inject: ["context"],
  props: {
    //特殊
    items: {
      type: Array,
      default: () => [],
    },
    // context:{
    //   type:Object
    // }
  },
  mounted() {
    console.log(this, "this");
  },
  methods: {
    log(...p) {
      console.log(...p);
    },
    set(target, prop, val) {
      Vue.set(target, prop, val);
      // if (Object.keys(target).includes(prop)) {
      //   target[prop] = val;
      // } else {
      //   Vue.set(target, prop, val);
      // }
    },
  },
};
</script>
